Refactor install and sync scripts #209