implement most of existing iveybot logic