Refactored a lot of the notes_controller