use SQLAclchemy. Big cleanup