separate parser into own object, add error handling, parse nested tags