Speed up by not calling find_terminals all the time