some code simplifications