move all logic into object