Cleaning up logic.