moved session factory into magnager parent class. extracting queries into separate xml file.