Cleaning up th code