Code clean up mostly