Major refactoring because the poorly named DB tables are driving me crazy