refactor to avoid duplication
Merge pull request #8 from boegel/imkl

refactor to avoid duplication