Name objects based on folder structure

Changed initialization code to name objects based on folder structure.