Refactoring implementation and creating new frontend for TypeChef