Refactored the command extraction into two commands, made some extra funcs.

Signed-off-by: Eliminioa <jmsboggs@gmail.com>