Moved serial code into a class