VID-952 Added additional docs and cleaned up code slightly