refactored the code for modularity,
added folder batch processing.