modularising the master info retrieval script.