should just be a function, more usable by different kinds of clients