some code simplification
another small fix