refactor getInfo* code. Args parsing using optparse added.