Moved some functions to the implement/ dir.