refactor geometry directive