Rainbow code dev and code cleanup