Slightly bettter performance; delete unused vars