added logging. added separate persistence module