More work on code refactor, smb and smbresult are mostly done