refactoring pandas_statement