Refactoring how create and search work