eror handling, splitting stuff up