more explicit error-handling, moved data init away from constructor