Moved some functions into the implement/ dir.