removed external function calls