Big commit - re-organized switch case and new implementations