moved code to parent class