Maindb constructor cleanup