Removed some redundant code and added Parser test