sandesh, mahendra | #208 | WIP; refactoring; tests pending