fixed performance issues, plus we are now using entity metadata!