Law of criminal procedure deals with