JS make more structured