javascript refactored and favicon added