Adding import configuration and cleaning up some code