updating and refactoring health bar