Move morph code into separate method