it can be clearer if this function does the work on its own