Wrapped database functionality into class