profiling code: get rid of duplication and make tests meaningful by comparing two different things