added many to one feature and some refactories