refactoring and comments in tenon module