refactors to js stylish