Simplify controller methods. Improve test case and testing database