Refactor to improve installation process