fork of scotty, to reduce code duplication, hopefully