more refactor wip..