Refactoring to fit with new structure