remove dynamic scoping + simplification