everything kinda there in refactored impl