Move basename to model
Model finds extention now
Make config a global variable