remove nested function