cosmetic code changes, change order of functions.