[WIP] Refactor signature checking and add additional checks