Some minor code simplification