updated to automatically set the type rather than using if statements

Signed-off-by: Tass Skoudros <tass@skystack.com>