mostly readability refactoring with helper methods for update and draw. more major chances to states and some structural rearrangement.