Touch ups in the scoping (ugly thing, lets refactor later)