refactoring and fixing favicon issue