Add loose coupling in db layer, add singleton function to instance container