refactoring partially done
cleanup