further refactor
todo: config