Refactored. No more barbarian style