refactors with a method