added browser sync and refactored code