separated code for performance testing