Add dotfiles fix, refactoring