refactoring / fixing small bugs / implementing search