Refactoring and decomplicating