combine some code