* reduced some scopes and fixed whitespaces