cleaned up scope. misc clean up