Reduced the line of codes for the apply buttons