Put this into a separate .scala file since it's a fairly large class