fix output
sanity test
refactoring