Directives refactor. Some cleanup.