merging maxkfranz's refactor