Getting rid of copied code