Moved implementation to separate detail files to avoid leaking public symbols