Cleaning up the implementation