add a test / minor refactoring
reformat