Moving reusing pieces of code