eliminating unnecessary commands