code refactored. abstract database class added. new db collection added