Rearange postgresl classes