removed some redundent function calls