Adding config support and adding max number of elements