updated module to be less flexible, but easier to maintain