improved code quality a bit