refactor to be a single directive, rather than two