move wiring compatibility functions for unit testing to separate file
fix array creation