Reshape a, g, b, c to be 1d.
Refactor: remove unneeded code