Separated database-related code intro separate module.