refactor into release and debug builds
refactor