Refactoring: Removed some of the state complexity