Improve (hopefully) terrible DB hacks