more logic cleanup