more refactor / cleanup