rearranged code into css, js and layout files