rewrite by 3.0 from https://github.com/fusijie/Airplane.git