Clean up

Removed the if-else and replaced with the parser.