Condensed some code