clean up scope handling in sema a lot