better separation of sync/unsafe code paths -> fix NPE