Minor optimization, old code cleanup