refactor PTT library