SWC-763 Fixed code block issue and cleaned up code