moved implementation into contract::detail namespace