moved logging into class