condensed some code