[FIX] Refactoring recording functionality.