more refctoring