refactored decorator