Might extract some logic to json file.