Refactor decisions JS