I tried to do some optimizations

Lets create a couple of tests for this module.