Refactor papers controller

@mispy need your review and thoughts here