add caching
refactor caching more composable