minor organization of code