TMP: Refactor into directive