Refactor and fill out step 5 with directives