more refactor work
refactor first draft