Added database handling, etc.