refactors controllers based on cats demo