remove tailing spaces
cover all braches in this factory test
missing tailing space
add missing use
fix typo