Cleaning up scope code.