make cache an option
also cleanup