refactoring: move pcm related stuff into a struct, rename some members