Refactor of original taboot-tailer code