Heavy refactoring pt.4