refactors parseSchema for better readability

Signed-off-by: Sam Heuck <sam@samheuck.com>