Cleaned the apply command and removed unnecessary parts