cleans up controller