optimize code
separate controller bl