added a view, did some refactoring