Implementing battery management systems