Simplified pointer tagging and moved it to detail namespace.