refactor spot using module pattern.