Refactor for Web and CLI users