big ass refactor overhaul