Fixed crash and moved stuff out of the utils package