Encapsulates an algorithm inside a class