mid flight refactor
refactor bug fixes