code cleanup
refactor for testing