refactoring using decorators