refactored markup and main js