moving all markup to JS for better control