moved stuff into separate class