fixed duplication
reduced duplication in logger