Modularizing so that i can implement caching