Condense and move code