Refactored code and added unit tests for the AudioResourceViewer