big code clean up