Refactoring to a bit smaller files