refactored out into seperate dll