restructure app and some configuration tweaks on middleman