extract method for common operation
remove useless if

args default to {} so is not nil