further efforts to get refactored code functional