Remove dependency on Flex