Added if, split apply out