Fixed the initial load bug that was happening (when you load the page, the view isn't rendered). Also general code cleanup