Factored mutable arrays code into separate file