Some rewrite code with fn py