Extracted the battery layer code.