moved code to object