Eliminated nested function