wip... consolodating code...