Refactored parse atom functions

Change-Id: I0a35f8664c0bd8e26dc50665329ff9822cca7bcf