Refractor code.