added utils service and moved options logic into util function