refactored abit. preparing to change to command pattern

Signed-off-by: Nicholas Lum <nicholaslum444@hotmail.com>