Further modification on database class