test passing
refactor tests and code