Refactored: Controllers and db providers divided