Formatting and removing unused Database functions