Separate out module logic to individual modules