refactoring throughout, added search functionality and style tweeks