General clenaup in code