we use the same code further down, so it should definitely be cleaned up