Improved and simplified the module a bit.