condensed code further