creating singleton for Db conn
some refactoring