refactor some stuff, add some headers to some views
minor code breakage and refactoring