fix controller factory and make routes less generic