add test + refactor
clean up