Fixed failing test
Moving code around
Tidy up controller code
Simplified utils code to inject db rows