factoring - new database scheme