Make controller smaller, remove unused code. Move creation of demand object into its own factory. Reduce npath complexity in repository and move parts into named methods.