Cleaning up to use the functions