major refactor: persistence layer; search