Refactored the types in the code.