reduce redundant code and added missing css files