refactor design js