Refactoring: add build_gemfile method