even though this code is the same on client, going to keep it here until we find a better name. simplifies