Added text factory. added sql decorators. cleaned controllers