Cleaning up the basic implementation