since this method is only used in one place and is quite simple, i decided to inline it