Cleaning up more logic