Begin great refactor
Finish search function