Remove hardcoded pattern lengths

Signed-off-by: mattchu <mrmatthewcollins@gmail.com>