add cacheable macro to clean the code up