refcatored the push back method