refactor demographics