Cleaned up the code to make the process of cacheing simpler.