move decorator to view function