remove dependency on flex