Refactoed some functions from submissions into new util module