Refactoring to the new style