Big code clean-up