moved logic into other class