put logic in right location.