this function looks weird, can we put a comment on what is its purpose ... ?