Refactor completed for layout/ templates