Refactor papers controller