Removed TODO: Test -ve bits.
Moved code to helper function. Added test todos.
[skip ci]