Refactored code and defined a structure with place holders