General code clenaup