Explain implementation for JDBC driver

Can you move all this a executeInternal() method and call the same from both explain and execute?