refactoring of core recording functionality into new HBRecording class