Replaced number method with use of class