refactor(common): toArray helper