reorganized some code to make more uniform naming conventions