Refactor install_dotfiles method