Refactor Module to prevent null algorithm calls