Remove the inner function to re-use the existing codes.