refactored by removing obsolete, commented code