Improve database class