emoved logging, tidied