Global refactoring to move sex table into database