deleted confusing parts
parser logic in separate class