Beginning of code cleanup