remove unnecessary commands