Better database handling
Better main method