Refactor model and begin controller
Many edits