Encapsulated the code.