refactor to prepare dll