greatly simplify the signature module and speed it up quite a bit