refactoring for SRP