refactored; ttype: implemented;