Refactored use of sid's in command_builder