more organizing of code