refactor style, js into files