Move all decisions to JS