signing refactoring and lame basic test