Refactored code, we can switch between flags now