Removing redundant function calls