Implementation of Bug algorithms family using the Template Method design pattern