added alternative refactoring