edit code cleanup -- separate everything into files