fix quality flaw (flow & dead code)