Update Gemfile and refactor erb tempate