use upstream, cleanup/refactor