Refactor and share init code between tools