refactor controllers, config, xhr and getData