Refactoring, better 'pattern'