refactor as npm and bower packages