Heavy refactoring for SRP