Refactored js and layout responsive