Simplified some function calls (thanks AlanJAS)