Refactorings: Extract method, State pattern, Rename method