code cleanup and re-org