Refactor ragel stuff