Using a class to encapsulate data and processing