moved code to spec