refactored from quickfort. this common implementation will replace the now redundant functions in quickfort, gui/mass-remove, and gui/blueprint