Optimize by moving principal.getName() outside for-loop.