refactor gemfile, add preview