code cleanup
added query projection
added query test on enum + code clean up