some code simplifications and 1 question