refactored store controller