Cleaned up parser