Refactored generates decorator